﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Program08
{
    /// <summary>
    /// 鸭子父类
    /// </summary>
   public class DuckBase
    {
        #region 自个整的
        //private IFlyBehavior flyBehavior;
        //private IQuackBehavior quackBehavior;

        ///// <summary>
        ///// 获取具体的飞行行为
        ///// </summary>
        //public void GetFly()
        //{
        //    flyBehavior.Fly();
        //}

        ///// <summary>
        ///// 获取具体的叫声行为
        ///// </summary>
        //public void GetQuack()
        //{
        //    quackBehavior.Quack();
        //}
        ///// <summary>
        ///// 添加飞行行为
        ///// </summary>
        ///// <param name="fly"></param>
        //public  void SetFly(IFlyBehavior fly)
        //{
        //    flyBehavior = fly;
        //}
        ///// <summary>
        ///// 添加叫声行为
        ///// </summary>
        ///// <param name="quack"></param>
        //public void SetQuack(IQuackBehavior quack)
        //{
        //    quackBehavior = quack;
        //}
        #endregion

        #region 特殊的行为
        public IFlyBehavior flyBehavior { get; set; }
        public IQuackBehavior quackBehavior { get; set; }
        #endregion

        public void Swim() { }

        /// <summary>
        /// 不同鸭子的名字
        /// </summary>
        public virtual string DisplayName() { return ""; }

        #region 老版本
        //public void Fly(object fly)
        //{
        //    Console.WriteLine(fly);
        //}
        //public void Quack(object quack)
        //{
        //    Console.WriteLine(quack);
        //}
        #endregion
    }
}
